import java.lang.ref.PhantomReference;
import java.lang.ref.ReferenceQueue;

/**
 * @author 龙小虬
 * @date 2021/4/14 23:24
 */
public class PhantomReferenceTset {
    public static void main(String[] args) {
        Entity user = new Entity("lxq");
        ReferenceQueue<Object> referenceQueue = new ReferenceQueue<>();
        PhantomReference<Entity> phantomReference = new PhantomReference<Entity>(user, referenceQueue);
        System.out.println(phantomReference.get());
    }
}
